package geppetto.cat.analysis;


import geppetto.cat.corpus.BilingualCorpus;

import java.io.PrintStream;
import java.util.ArrayList;



public class ErrorByForeignWord {
	int _nrErrors = 0;

	int _wordId;

	ArrayList<AlignmentError> _errors;

	public ErrorByForeignWord(int wordId) {
		_nrErrors = 0;
		_wordId = wordId;
		_errors = new ArrayList<AlignmentError>();
	}

	public void addError(AlignmentError error) {
		_nrErrors++;
		_errors.add(error);
	}

	public void output(BilingualCorpus corpus, PrintStream out) {
		out.println("Word = " + corpus.getForeignWordById(_wordId)
				+ " nr-errors " + _nrErrors);
		for (AlignmentError err : _errors) {
			err.output(corpus, out);
		}
	}
}
